package com.atkxp.stustatusmasystem.service;

import com.atkxp.stustatusmasystem.mapper.TeacherMapper;
import com.atkxp.stustatusmasystem.pojo.Student;
import com.atkxp.stustatusmasystem.pojo.Teacher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author user
 * @declaration
 * @create 2023/5/26-19:53
 */
@Service
public class TeacherServicelmpl implements TeacherService{

    @Autowired
    public TeacherMapper teacherMapper;

    @Override
    public Teacher login(String tid, String password) {
        return teacherMapper.queryTeaByTidAndPassword(tid, password);
    }

    @Override
    public List<Teacher> getAllTeacher() {
        return teacherMapper.getAllTeacher();
    }

    @Override
    public Long getTeacherCount() {
        return teacherMapper.getTeacherCount();
    }

    @Override
    public Long getAdminCount() {
        return teacherMapper.getAdminCount();
    }

    @Override
    public Teacher getTeacherByTid(String tid) {
        return teacherMapper.getTeacherByTid(tid);
    }

    @Override
    public int addTeacher(Teacher teacher) {
        return teacherMapper.addTeacher(teacher);
    }

    @Override
    public int deleteTeacherById(int id) {
        return teacherMapper.deleteTeacherById(id);
    }

    @Override
    public int updateTeacherById(Teacher teacher) {
        return teacherMapper.updateTeacherById(teacher);
    }

    @Override
    public Teacher getTeacherById(int id) {
        return teacherMapper.getTeacherById(id);
    }
}
